/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.converter;

import br.com.deployment.entidade.localidade.Cidade;
import br.com.deployment.entidade.selo.CorSelo;
import br.com.deployment.entidade.registroimovel.Imovel;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

/**
 *
 * @author roniere
 */ 
@FacesConverter(value="corConverter")
public class CorSeloConverter implements Converter{    
    @Override
    public Object getAsObject(FacesContext fc, UIComponent uic, String string) {
        CorSelo cor = new CorSelo();
        cor.setId(Integer.valueOf(string));  
        return cor;
    }

    @Override
    public String getAsString(FacesContext fc, UIComponent uic, Object value) {
        CorSelo cor = (CorSelo) value;
        return "" + cor.getId();
    }

}